import { Entity, Column, Unique, Index } from 'typeorm'
import { BaseEntity } from '../global'

@Entity('user_token')
export class UserToken extends BaseEntity {
    @Column({ length: 32, comment: 'userid' })
    userid: string

    @Index()
    @Column({ length: 128, comment: '设备唯一ID' })
    devid: string

    @Column({ length: 32, comment: '最后一次鉴权记录' })
    authid: string

    @Index()
    @Column({ length: 128, comment: '登录态' })
    tokenValue: string

    @Column({ length: 32, comment: '登录态生成的时间' })
    tokenTime: string
}
